import queue

class AppState:
    def __init__(self):
        # 基础状态
        self.is_recording = False
        self.server_connected = False
        self.wake_word_detected = False
        self.waiting_for_wake = True  # 初始为等待唤醒状态
        self.current_transcript = ""
        self.wave_bars = [5] * 30  # 波形条初始值
        
        # 音频数据队列
        self.audio_queue = queue.Queue()
        
        # 计数器
        self.silence_counter = 0
        self.reconnect_count = 0
        
        # 通知和命令
        self.active_commands = []
        self.notifications = []
        
        # 连接引用
        self.ws_connection = None
        self.recorder = None

# 全局状态单例对象
app_state = AppState()